package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.AsyType;
import com.zcx.helper.http.note.HttpCache;
import com.zcx.helper.http.note.HttpInlet;
import com.zcx.helper.http.note.HttpNew;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/6/25.
 */
@HttpInlet(Conn.INLET_API_INSURANCE_VEHICLE_OFFER)
public class GetApiVehileBaoJia extends BaseAsyGet<GetApiVehileBaoJia.Info> {
    public String cid;

    public GetApiVehileBaoJia(AsyCallBack<GetApiVehileBaoJia.Info> asyCallBack) {
        super(asyCallBack);
    }

    protected Info parser(JSONObject jsonObject) {
        TOAST = jsonObject.optString("message");
        if (jsonObject.optInt("code") == 200) {
            Info info = new Info();
            Data d = new Data();

            JSONObject o = jsonObject.optJSONObject("data");
            d.nowfee = o.optString("nowfee");
            d.backfee = o.optString("backfee");
            d.fine = o.optString("fine");
            d.total = o.optString("total");

            info.data = d;
            return info;
        }
        return null;
    }

    public static class Info {
        public String code, message;
        public Data data;
    }

    public static class Data {
        //        "nowfee": "500.00",
//                "backfee": "200.00",
//                "fine": "300.00",
//                "total": 1000
        public String nowfee, backfee, fine, total;
    }
}
